package org.obm.cassandra.client.tests;

import junit.framework.TestCase;
import me.prettyprint.cassandra.service.CassandraClient;
import me.prettyprint.cassandra.service.CassandraClientPool;

import org.obm.cassandra.client.CassHelper;

public abstract class CassandraTest extends TestCase {

	protected static final int COUNT = 5000;
	protected CassandraClient client;

	protected void setUp() {
		CassandraClientPool pool = org.obm.cassandra.client.Activator
				.getDefault().getPool();
		assertNotNull(pool);

		try {
			client = pool.borrowClient();
			assertNotNull(client);
		} catch (Exception e) {
			e.printStackTrace();
			fail();
		}
	}

	protected void tearDown() {
		CassHelper.cleanup(client);
	}

}
